/**
 *
 * 组件数据文件
 *
 * file  : D_components.js
 * create: 2012-12-10
 * author: yangzheng@evmtv.com
 * update: 2013-01-14
 * 2013-05-24: +页码、栏目路径、当前栏目
 *
 */

var	DS_Components =
{
	id:'SL1',
	width:'100%',
	height:'',
	autoCollapse:0,

	nodes:
	[
		//
		{ id:'Layout', c:'布局 | Layout'
			,content:'eComp_Layout', glyphSrc: 'assets/images/comp_glyphs.png'
			,comps:
			[
				 {id:0, text:'横向排列',	clsName:'CmsComp_Layout_Hori',	glyph:{w:48, h:48, x:48, y:0}, hint:'横向排列布局'}
				,{id:1, text:'纵向排列',	clsName:'CmsComp_Layout_Vert',	glyph:{w:48, h:48, x:96, y:0}, hint:'纵向排列布局'}
				
				,{ id:2, text:'滚动'
					,clsName:'CmsComp_Layout_Marquee', glyph:{w:48, h:48, x:1008, y:0}, hint:'内容滚动布局'
					,onCreate: function( P )
					{
						var text = '{%$文章正文%}';
						var C = $.createElement({type:'marquee',id:P.id,css:'width:400px;height:300px;fontSize:26px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.scrollAmount = 5;
							C.scrollDelay = 1;
							C.direction = 'up';
							C.style.backgroundAttachment = 'fixed';
							C.innerHTML = text;

						P.xJsObject.persistentProperty.push('scrollAmount');
						P.xJsObject.persistentProperty.push('scrollDelay');
						P.xJsObject.persistentProperty.push('direction');

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
							P.xJsObject.backgroundAttachment = 'fixed';

							P.xJsObject.scrollAmount = 5;
							P.xJsObject.scrollDelay = 1;
							P.xJsObject.direction = 'up';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;

								case 'direction':
									elemComponent.direction = V;
									break;

								case 'scrollAmount':
									elemComponent.scrollAmount = V;
									break;

								case 'scrollDelay':
									elemComponent.scrollDelay = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						with( S )
						{
							return '<marquee id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' direction="' + S.direction + '"'
								+ ' scrollamount="' + S.scrollAmount + '"'
								+ ' scrolldelay="' + S.scrollDelay + '"'
								+ ' style="position:absolute;' + CmsHelper.CssToString( S ) + '"'
								+ '>' + elemComponent.innerHTML + '</marquee>';
						}
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'滚动', field:'text' }
						,{ id:'direction',text:'滚动方向',hint:'',	type:'select',	defaultValue:'', field:'direction', options:[{text:'向上',value:'up'},{text:'向下',value:'down'},{text:'向左',value:'left'},{text:'向右',value:'right'}] }
						,{ id:'scrollAmount',	text:'滚动速度',	hint:'',	type:'number',	defaultValue:'1', field:'scrollAmount' }
						,{ id:'scrollDelay',	text:'滚动延时',	hint:'',	type:'number',	defaultValue:'1', field:'scrollDelay' }
					]
				}
			]
		}

		//
		,{ id:'Content', c:'内容 | Text'
			,content:'eComp_Text', glyphSrc: 'assets/images/comp_glyphs.png'
			,comps:
			[
				{ id:0, text:'标题'
					,clsName:'CmsComp_Text_Title', glyph:{w:48, h:48, x:144, y:0}, hint:'文章标题'
					,onCreate: function( P )
					{
						var text = '文章标题';
						var C = $.createElement({type:'div',id:P.id,css:'width:400px;height:40px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							C.innerHTML = text;
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 32).css('background','')
								.event('resize',function()
								{
									var E = $.getEvent();
									if( E && !E.altKey )
									{
										var o = $(this), h = o.css('height');
										o.css('fontSize', h);
										this.xJsObject.fontSize = h;
									}

									Designer.control.updateProperty( {src:this.xJsObject, keys:['fontSize']} );
								});
							
						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 32;
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ '>{%$文章标题%}</div>';
					 }
				}
				
				,{ id:1, text:'正文'
					,clsName:'CmsComp_Text_Content', glyph:{w:48, h:48, x:192, y:0}, hint:'文章正文'
					,onCreate: function( P )
					{
						var text = '悟已往之不谏 知来者之可追<br>实迷途其未远 觉今是而昨非<br>';
						text += text;text += text;text += text;text += text;text += text;text += text;
						var C = $.createElement({type:'div',id:P.id,css:'width:400px;height:300px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 24).css('background','');
							C.innerHTML = text;

						P.xJsObject.persistentProperty.push('lineHeight');
						P.xJsObject.persistentProperty.push('displayMode');

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '';
							P.xJsObject.lineHeight = '24';
							P.xJsObject.displayMode = 0;
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									text = V;
									break;

								case 'displayMode':
									displayMode = V;
									break;

								case 'lineHeight':
									lineHeight = V;
									elemComponent.style.lineHeight = V + 'px';
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"'
								+ ' CMS_ContentWidth="' + S.width + '" CMS_ContentHeight="' + S.height + '"'
								+ ' CMS_ContentDisplayMode="' + S.displayMode + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">{%$文章正文%}</div>';
					 }
					,onGetJsCode: function( S, A )
					{
						var E = '';
						/*switch( A )
						{
							case 'init':
								return S.displayMode == 0 ? '_Content_Init' : '';
								break;
							
							default:
								E = S.displayMode == 1 ? '' :
								'function _Content_EvtListener(E)\n'
								+ '{\n'
								+ '\tvar K = swat.platform.mappingKey(E);\n'
								+ '\tswitch(K)\n'
								+ '\t{\n'
								+ '\tcase "DOWN":\n'
								+ '\t\t$("' + S.id + '").scrollTop += 100;\n\t\tbreak\n'
								+ '\tcase "UP":\n'
								+ '\t\t$("' + S.id + '").scrollTop -= 100;\n\t\tbreak\n'
								+ '\t}\n}\n'
								+ 'function _Content_Init()\n{\n\t$G.eventListener.addListener(_Content_EvtListener);\n}';
						}*/
						switch( A )
						{
							case 'import':
								E = '<script type="text/javascript" src="../../assets/emsp_cms/js/cms_compExt_Content.js"></script>';
								//E += '<script type="text/javascript">var $CMS_Content_PageNum = 0;</script>';
								break;
						}
						return E;
					}
					,properties:
					[
						 { id:'lineHeight',	text:'行间距',	hint:'',	type:'number',	defaultValue:'', field:'lineHeight' }
						,{ id:'displayMode',text:'显示方式',hint:'',	type:'select',	defaultValue:'', field:'displayMode', options:[{text:'滚动',value:0},{text:'分页',value:1}] }
						,{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}
				
				,{ id:2, text:'静态文字'
					,clsName:'CmsComp_Text_Static', glyph:{w:48, h:48, x:240, y:0}, hint:'固定在页面上的文字'
					,onCreate: function( P )
					{
						var text = '静态文字';
						var C = $.createElement({type:'div',id:P.id,css:'width:100px;height:30px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 24).css('background','');
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									text = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">'
								+ S.text
								+ '</div>';
					 }

					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}

				,{ id:3, text:'日期'
					,clsName:'CmsComp_Text_Date', glyph:{w:48, h:48, x:288, y:0}, hint:'文章采集日期'
					,onCreate: function( P )
					{
						var text = '发布时间: {%$文章发布时间%}';
						var C = $.createElement({type:'div',id:P.id,css:'width:300px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 20).css('background','').text( text );

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 20;
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">{%$文章发布时间%}</div>';
					 }
					 ,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}

				,{ id:4, text:'作者'
					,clsName:'CmsComp_Text_Author', glyph:{w:48, h:48, x:336, y:0}, hint:'文章来源'
					,onCreate: function( P )
					{
						var text = '文章来源: {%$文章来源%}';
						var C = $.createElement({type:'div',id:P.id,css:'width:230px;height:30px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 20).css('background','').text( text );

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 20;
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">{%$文章来源%}</div>';
					 }
					 ,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}

				,{ id:5, text:'超链接'
					,clsName:'CmsComp_Text_HLink', glyph:{w:48, h:48, x:0, y:0}, hint:''
					,onCreate: function( P )
					{
						var text = '#';
						var C = $.createElement({type:'div',id:P.id,css:'width:300px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 18).css('background','').text( text );

						P.xJsObject.persistentProperty.push('href');
						
						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 18;
							P.xJsObject.color = '#369';
							P.xJsObject.backgroundColor = '';
							P.xJsObject.href = text;
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									text = V;
									break;

								case 'href':
									href = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						var E;
						with( S )
						{
							E = '<a id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' href="' + S.href + '"'
								+ ' style="' + CmsHelper.CssToString( S ) + '">'
								+ S.text
								+ '</a>';
						}
						return E;
					 }
					 ,properties:
					[
						 { id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
						,{ id:'href',	text:'目标URL',	hint:'',	type:'text',	defaultValue:'', field:'href' }
					]
				}

				,{ id:6, text:'栏目路径'
					,clsName:'CmsComp_Col_Path', glyph:{w:48, h:48, x:240, y:0}, hint:'当前栏目路径'
					,onCreate: function( P )
					{
						var text = '{%$栏目路径%}';
						var C = $.createElement({type:'div',id:P.id,css:'width:400px;height:30px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 20).css('background','').text( text );

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#FFFFFF';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">{%$栏目路径%}</div>';
					 }
					 ,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}

				,{ id:7, text:'当前栏目'
					,clsName:'CmsComp_Col_Path', glyph:{w:48, h:48, x:240, y:0}, hint:'当前栏目名称'
					,onCreate: function( P )
					{
						var text = '{%$当前栏目%}';
						var C = $.createElement({type:'div',id:P.id,css:'width:400px;height:30px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 20).css('background','').text( text );

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#FFFFFF';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">{%$当前栏目%}</div>';
					 }
					 ,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}
			]
		}

		//
		,{ id:'Media', c:'媒体 | Media'
			,content:'eComp_Media', glyphSrc: 'assets/images/comp_glyphs.png'
			,comps:
			[
				{ id:0, text:'图片',
					clsName:'CmsComp_Image_Static', glyph:{w:48, h:48, x:384, y:0}, hint:'插入图片'
					,onCreate: function( P )
					{
						var C = $.createElement({type:'div',id:P.id,css:'width:139px;height:36px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);

						var IMG = $.createElement({type:'img',id:P.id+'_Img',css:'width:139px;height:36px',attr:{exDragable:1,exSizable:1,exPass:1}});
							IMG.style.width = '100%';
							IMG.style.height = '100%';
							IMG.src = 'assets/images/cms_comp_image_sample.png';
							C.appendChild(IMG);
						
						P.xJsObject.elemImg = IMG;
						P.xJsObject.persistentProperty.push('src');

						if( P.isNewCreate )
						{
							P.xJsObject.src = IMG.src;
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'src':
									src = V;
									elemImg.src = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<img id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' src="' + S.src + '"'
								+ ' style="position:absolute;' + CmsHelper.CssToString( S ) + '"/>';
					 }

					,properties:
					[
						{ id:'src', text:'图片URL',	hint:'',	type:'image',	defaultValue:'', field:'src' }
					]
				}

				,{ id:1, text:'背景图片',
					clsName:'CmsComp_Image_BkgImage', glyph:{w:48, h:48, x:384, y:0}, hint:'插入背景图片'
					,onCreate: function( P )
					{
						var C = $.createElement({type:'div',id:P.id,css:'width:400px;height:300px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.backgroundImage = 'url(assets/images/comp_bkgImage_sample.jpg)';
							C.backgroundRepeat = 'repeat';
						
						if( P.isNewCreate )
						{
							P.xJsObject.backgroundImage = 'assets/images/comp_bkgImage_sample.jpg';
							P.xJsObject.backgroundRepeat = 'repeat';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"></div>';
					 }

					,properties:
					[
					]
				}

				,{ id:2, text:'QAM视频',
					clsName:'CmsComp_Media_QAM', glyph:{w:48, h:48, x:528, y:0}, hint:'通过 IPQAM 点播的视频'
				}
				
				,{ id:3, text:'IPTV视频'
					,clsName:'CmsComp_Media_IPTV', glyph:{w:48, h:48, x:576, y:0}, hint:'通过 IPTV 点播的视频'
					,onCreate: function( P )
					{
						text = 'IPTV 嵌入视频';
						var C = $.createElement({type:'div',id:P.id,css:'width:320px;height:240px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 16).css('textAlign','center').css('background','#000 url(assets/images/cms_comp_iptvVideo.png) no-repeat center').text( text );

						P.xJsObject.persistentProperty.push('VOD_URI');

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = '24';
							P.xJsObject.color = '#ccc';
							P.xJsObject.backgroundColor = '#000';
							P.xJsObject.backgroundImage = 'assets/images/cms_comp_iptvVideo.png';
							P.xJsObject.backgroundRepeat = 'no-repeat';
							P.xJsObject.backgroundPosition  = 'center';
							P.xJsObject.VOD_URI = 'rtsp://';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'VOD_URI':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.id + '"\n\t'
							+ ' CMS_Class="' + S.data.clsName + '"\n\t'
							+ ' style="' + CmsHelper.CssToString( S ) + '">'
							+ S.elemComponent.innerHTML;
							+ '</div>';
					 }

					,properties:
					[
						{ id:'VOD_URI',	text:'点播资源URI',	hint:'',	type:'text',	defaultValue:'', field:'VOD_URI' }
					]
				}

				,{ id:4, text:'FLV视频',
					clsName:'CmsComp_Media_FLV', glyph:{w:48, h:48, x:624, y:0}, hint:'FLV 格式视频'
				}

				,{ id:5, text:'音频',
					clsName:'CmsComp_Media_Audio', glyph:{w:48, h:48, x:672, y:0}, hint:'音频文件'
				}
			]
		}

		//
		,{ id:'Control', c:'控制 | Control'
			,content:'eComp_Control', glyphSrc: 'assets/images/comp_glyphs.png'
			,comps:
			[
				{ id:0, text:'上一页'
					,clsName:'CmsComp_Ctrl_PrevPage', glyph:{w:48, h:48, x:720, y:0}, hint:'分页控制: 转到上一页'
					,onCreate: function( P )
					{
						var text = '上一页';
						var C = $.createElement({type:'button',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_Prev"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="if(CmsExt_Content)CmsExt_Content.Pager.pageTo(\'<\')">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'上一页', field:'text' }
					]
				}

				,{ id:1, text:'下一页'
					,clsName:'CmsComp_Ctrl_NextPage', glyph:{w:48, h:48, x:768, y:0}, hint:'分页控制: 转到下一页'
					,onCreate: function( P )
					{
						var text = '下一页';
						var C = $.createElement({type:'button',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_Next"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="if(CmsExt_Content)CmsExt_Content.Pager.pageTo(\'>\')">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'下一页', field:'text' }
					]
				}

				,{ id:2, text:'第一页'
					,clsName:'CmsComp_Ctrl_FirstPage', glyph:{w:48, h:48, x:816, y:0}, hint:'分页控制: 转到第一页'
					,onCreate: function( P )
					{
						var text = '第一页';
						var C = $.createElement({type:'button',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize',24);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_First"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="if(CmsExt_Content)CmsExt_Content.Pager.pageTo(\'<<\')">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'第一页', field:'text' }
					]
				}

				,{ id:3, text:'最末页'
					,clsName:'CmsComp_Ctrl_LastPage', glyph:{w:48, h:48, x:864, y:0}, hint:'分页控制: 转到最末页'
					,onCreate: function( P )
					{
						var text = '最末页';
						var C = $.createElement({type:'button',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_Last"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="if(CmsExt_Content)CmsExt_Content.Pager.pageTo(\'>>\')">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'最末页', field:'text' }
					]
				}

				,{ id:4, text:'返回到主页'
					,clsName:'CmsComp_Ctrl_GoHome', glyph:{w:48, h:48, x:912, y:0}, hint:'跳转: 返回到网站主页'
					,onCreate: function( P )
					{
						var text = '返回主页';
						var C = $.createElement({type:'button',id:P.id,css:'width:120px;height:40px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_Next"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="swat.gotoUrl(\'{%$网站主页URL%}\')">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'返回主页', field:'text' }
					]
				}

				,{ id:5, text:'返回到上页'
					,clsName:'CmsComp_Ctrl_GoBack', glyph:{w:48, h:48, x:960, y:0}, hint:'跳转: 返回到上个页面'
					,onCreate: function( P )
					{
						var text = '返回上页';
						var C = $.createElement({type:'button',id:P.id,css:'width:120px;height:40px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="CMS_ContentPager_Next"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								//+ ' onclick="swat.gotoUrl(\'{%$来源页URL%}\')">' + S.text + '</button>';
								+ ' onclick="history.go(-1)">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'返回上页', field:'text' }
					]
				}

				,{ id:6, text:'按钮'
					,clsName:'CmsComp_Button', glyph:{w:48, h:48, x:432, y:0}, hint:'普通按钮'
					,onCreate: function( P )
					{
						/*
						var C = $.createElement({type:'div',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
						var btn = $.createElement({type:'button',id:P.id+'_Btn',css:'width:100%;height:100%',attr:{xJsObject:P.xJsObject,className2:'T_Component',xText:'按钮',exPass:1,exSizable:1}});
							btn.innerHTML = '按钮';
						C.appendChild( btn );
						
						P.xJsObject.elemButton = btn;
						
						P.xJsObject.persistentProperty.push('action');

						if( P.isNewCreate )
						{
							P.xJsObject.text = '按钮';
							P.xJsObject.action = '';
						}*/
						
						var C = $.createElement({type:'button',id:P.id,css:'width:100px;height:30px',attr:{xJsObject:P.xJsObject,className:'T_Component',xText:'按钮',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = '按钮';
						
						P.xJsObject.persistentProperty.push('action');

						if( P.isNewCreate )
						{
							P.xJsObject.text = '按钮';
							P.xJsObject.action = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;

								case 'action':
									action = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="position:absolute;' + CmsHelper.CssToString( S ) + '"'
								+ ( S.action ? ' onclick="' + S.action + '"' : '' )
								+ '>' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'按钮', field:'text' }
						,{ id:'action',	text:'响应动作',	hint:'',	type:'text',	defaultValue:'', field:'action' }
					]
				}

				,{ id:7, text:'图片按钮'
					,glyph:{w:48, h:48, x:480, y:0}, hint:'带图片的按钮'
				}

				,{ id:8, text:'页码'
					,clsName:'CmsComp_Ctrl_Pagination', glyph:{w:48, h:48, x:240, y:0}, hint:'页码信息, 出现在每页固定位置'
					,onCreate: function( P )
					{
						var text = '0 / 0';
						var C = $.createElement({type:'div',id:P.id,css:'width:100px;height:30px;overflow:hidden',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y).css('fontSize', 24).css('background','');
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 24;
							P.xJsObject.color = '#FFFF00';
							P.xJsObject.backgroundColor = '';
						}

						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									text = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<div id="' + S.data.clsName + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '">'
								+ S.text
								+ '</div>';
					 }

					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'', field:'text' }
					]
				}

				,{ id:9, text:'滚屏控制'
					,clsName:'CmsComp_Ctrl_ScrollCtrl', glyph:{w:48, h:48, x:960, y:0}, hint:'滚屏控制 (暂停/继续滚屏)'
					,onCreate: function( P )
					{
						var text = '停止滚动';
						var C = $.createElement({type:'button',id:P.id,css:'width:120px;height:40px',attr:{xJsObject:P.xJsObject,className:'T_Component',exDragable:1,exTopOnDrag:1,exSizable:1}});
							$(C).css('left',P.x).css('top',P.y);
							C.innerHTML = text;

						if( P.isNewCreate )
						{
							P.xJsObject.text = text;
							P.xJsObject.fontSize = 26;
							P.xJsObject.color = '#000';
							P.xJsObject.backgroundColor = '';
							P.xJsObject.assocComp = '';
							P.xJsObject.scrollState = '1';
						}
						
						return C;
					}
					,onSetProperty: function( F, V )
					{
						with( this )
						{
							switch( F )
							{
								case 'text':
									elemComponent.innerHTML = V;
									break;

								case 'assocComp':
									assocComp = V;
									break;

								case 'scrollState':
									scrollState = V;
									break;
							}
						}
					}
					,onGetHtmlCode: function( S )
					 {
						return '<button id="' + S.id + '"\n\t'
								+ ' CMS_Class="' + S.data.clsName + '"\n\t'
								+ ' scrollState="1"\n\t'
								+ ' assocComp="' + S.assocComp + '"\n\t'
								+ ' style="' + CmsHelper.CssToString( S ) + '"'
								+ ' onclick="CMS_CompCtrl.scrollCtrl(this)">' + S.text + '</button>';
					 }
					,properties:
					[
						{ id:'text',	text:'文字',	hint:'',	type:'text',	defaultValue:'停止滚动', field:'text' },
						{ id:'assocComp',	text:'关联组件',	hint:'',	type:'text',	defaultValue:'', field:'assocComp' }
					]
				}
			]	
		}

		//
		,{ id:'Ext', c:'扩展 | Extension'
			,content:'eComp_Extension', glyphSrc: 'assets/images/comp_glyphs.png'
			,comps:
			[
			]
		}
	] // end of nodes
}

// 组件公共属性
var DS_ComponentProperty =
{
	properties:
	[
		 { id:'classType',		text:'组件基类',	hint:'',	type:'text',	defaultValue:'', field:'classType',			readOnly:1 }	
		,{ id:'componentName',	text:'组件子类',	hint:'',	type:'text',	defaultValue:'', field:'componentName',		readOnly:1 }
		,{ id:'id',				text:'ID',			hint:'',	type:'text',	defaultValue:'', field:'id',				readOnly:1 }
		,{ id:'left',			text:'左',			hint:'',	type:'number',	defaultValue:'', field:'left' }
		,{ id:'top',			text:'上',			hint:'',	type:'number',	defaultValue:'', field:'top' }
		,{ id:'width',			text:'宽度',		hint:'',	type:'number',	defaultValue:'', field:'width' }
		,{ id:'height',			text:'高度',		hint:'',	type:'number',	defaultValue:'', field:'height' }
		,{ id:'fontSize',		text:'文字大小',	hint:'',	type:'number',	defaultValue:'', field:'fontSize' }
		,{ id:'fontStyle',		text:'文字样式',	hint:'',	type:'select',	defaultValue:'', field:'fontStyle', options:[{text:'默认',value:''},{text:'倾斜',value:'italic'}] }
		,{ id:'fontWeight',		text:'文字粗细',	hint:'',	type:'select',	defaultValue:'', field:'fontWeight', options:[{text:'默认',value:''},{text:'细',value:'lighter'},{text:'粗',value:'bold'},{text:'加粗',value:'bolder'}] }
		,{ id:'color',			text:'文字颜色',	hint:'',	type:'color',	defaultValue:'', field:'color' }
		,{ id:'textAlign',		text:'内容排列方式',	hint:'',	type:'select',	defaultValue:'', field:'textAlign', options:[{text:'默认',value:''},{text:'居左',value:'left'},{text:'居中',value:'center'},{text:'居右',value:'right'},{text:'分散',value:'justify'}]}
		,{ id:'backgroundColor',text:'背景颜色',	hint:'',	type:'color',	defaultValue:'', field:'backgroundColor' }
		,{ id:'backgroundImage',text:'背景图片',	hint:'',	type:'image',	defaultValue:'', field:'backgroundImage' }
		,{ id:'backgroundRepeat',text:'背景显示方式',	hint:'',	type:'select',	defaultValue:'', field:'backgroundRepeat', options:[{text:'平铺',value:'repeat'},{text:'水平重复',value:'repeat-x'},{text:'垂直重复',value:'repeat-y'},{text:'不重复',value:'no-repeat'}]}
		,{ id:'zIndex',			text:'层级',	hint:'',	type:'number',	defaultValue:'1', field:'zIndex' }
	]
}

// 模板公共属性
var DS_TemplateProperty =
{
	properties:
	[
		 { id:'classType',		text:'组件基类',	hint:'',	type:'text',	defaultValue:'', field:'classType',			readOnly:1 }
		,{ id:'templateName',	text:'模板名称',	hint:'',	type:'text',	defaultValue:'', field:'templateName' }
		,{ id:'id',				text:'ID',			hint:'',	type:'text',	defaultValue:'', field:'id',				readOnly:1 }
		,{ id:'left',			text:'左',			hint:'',	type:'number',	defaultValue:'', field:'left' }
		,{ id:'top',			text:'上',			hint:'',	type:'number',	defaultValue:'', field:'top' }
		,{ id:'width',			text:'宽度',		hint:'',	type:'number',	defaultValue:'', field:'width' }
		,{ id:'height',			text:'高度',		hint:'',	type:'number',	defaultValue:'', field:'height' }
		,{ id:'color',			text:'文字颜色',	hint:'',	type:'color',	defaultValue:'', field:'color' }
		,{ id:'backgroundColor',text:'背景颜色',	hint:'',	type:'color',	defaultValue:'', field:'backgroundColor' }
		,{ id:'backgroundImage',text:'背景图片',	hint:'',	type:'image',	defaultValue:'', field:'backgroundImage' }
		,{ id:'backgroundRepeat',text:'背景显示方式',	hint:'',	type:'select',	defaultValue:'', field:'backgroundRepeat', options:[{text:'平铺',value:'repeat'},{text:'水平重复',value:'repeat-x'},{text:'垂直重复',value:'repeat-y'},{text:'不重复',value:'no-repeat'}]}
	]
}
